package org.calzz.example;

import javax.servlet.http.HttpSession;

import org.calzz.rpc.controller.Session;
import org.springframework.stereotype.Controller;

@Controller("Shop")
public class CartController {

	public void newShoppingCart(HttpSession session) {
		session.setAttribute("cart", new ShoppingCart());
	}

	public void addItem(@Session("cart") ShoppingCart cart, Item item) {
		cart.add(item);
	}

	public ShoppingCart getShoppingCartContents(@Session("cart") ShoppingCart cart) {
		return cart;
	}

}
